package com.sfac.modules.account.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sfac.modules.account.domain.Role;
import com.sfac.modules.account.domain.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserRoleMapper extends BaseMapper<UserRole> {

    /**
     * 查询角色权限
     * @param id
     * @return
     */
    @Select("select account_role.* from account_role JOIN account_user_role ON account_role.id = account_user_role.role_id and account_user_role.user_id = #{id}")
    List<Role> selectRoleByUserId(String id);
}
